﻿package commands 
{
	import flash.utils.ByteArray;
	import commands.classesinfo.*;
	
	/**
	 * ...
	 * @author wwx
	 * 50000006 通知可选操作（当前轮到操作的玩家）
	 */
	public class NotifyToChooseoperateCmd extends abCommand 
	{
		
		public function NotifyToChooseoperateCmd() //: abCommand(CommandType.CMD_TYPE_NOTIFYTOCHOOSEOPERATE)  
		{
			super(CommandType(CommandType.CMD_TYPE_NOTIFYTOCHOOSEOPERATE));
			minBringChip = 0;
			minInject = 0;
		}
		
		public var msgSeq:int;//消息号
		public var errorNum:int;//错误号	
		
		public var bringChip:int;//带入筹码;0：不要求带入,1：要求带入筹码（当前筹码为0）
		public var minBringChip:int;//最小带入筹码值,当“要求带入筹码” 为1时有该字段
		public var startPlay:int;//开始游戏; 0：*,1：提示开始游戏
		public var inject:int;//下注,0：不可下注,1：可下注
		public var minInject:int;//最小加注额,当 可加注 时有该字段
		public var follow:int;//跟牌,0：不可跟,1：可跟
		public var pass:int;//过牌,0：不可过牌,1：可过牌
		public var sohandle:int;//全下,0：不可全下,1：可全下
		public var giveup:int;//弃牌,0：不可弃牌,1：可弃牌
	
		public function convertToCmd(bytes:ByteArray, offset:int, len:int):int
		{
			var ret:int = -1;
			msgSeq = (int) (bytes[offset + 0]) + ((int(bytes[offset + 1])) << 8) + ((int(bytes[offset + 2])) << 16) + ((int(bytes[offset + 3])) << 24);
			offset += 4;
			errorNum = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			
			bringChip = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			if (1 == bringChip)
			{
				minBringChip = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
				offset += 4;
			}
			startPlay = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			inject = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			if (1 == inject)
			{
				minInject = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
				offset += 4;
			}
			follow = (int)(bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			pass = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			sohandle = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			giveup = (int) (bytes[offset + 0]) + ((int(bytes[offset+1])) << 8) + ((int(bytes[offset+2])) << 16) + ((int(bytes[offset+3])) << 24);
			offset += 4;
			
			return 0;
		}			
	}
	
}